<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>爱购物-商城 - 首页</title>
    <link type="text/css" rel="stylesheet" href="css/style.css"/>
    <script type="text/javascript" src="scripts/function.js"></script>

    <script language="javascript">

        function ScrollImgLeft() {
            var speed = 20
            var scroll_begin = document.getElementById("scroll_begin");
            var scroll_end = document.getElementById("scroll_end");
            var scroll_div = document.getElementById("scroll_div");
            scroll_end.innerHTML = scroll_begin.innerHTML

            function Marquee() {
                if (scroll_end.offsetWidth - scroll_div.scrollLeft <= 0)
                    scroll_div.scrollLeft -= scroll_begin.offsetWidth
                else
                    scroll_div.scrollLeft++
            }

            var MyMar = setInterval(Marquee, speed)
            scroll_div.onmouseover = function () {
                clearInterval(MyMar)
            }
            scroll_div.onmouseout = function () {
                MyMar = setInterval(Marquee, speed)
            }
        }

        function selectname() {
            var name = document.getElementById("selectname").value;
            location.href = 'selectProductList?name=' + name;
        }

        function searchHot(name) {
            location.href = 'selectProductList?name=' + name;
        }
    </script>


</head>
<body>
<div id="header" class="wrap">
    <div id="logo"><img src="images/logo.png"/></div>
    <div class="help"><c:if test="${name!=null}"><a href="selectdd?dd=${name.eu_user_id }">个人订单</a></c:if><c:if
            test="${name!=null}">当前用户${name.eu_user_id }</c:if><a href="ShopSelect" class="shopping">购物车</a><c:if
            test="${name==null}"><a href="login.jsp">登录</a>|<a href="register.jsp">注册</a></c:if><c:if
            test="${name!=null}"><a href="zx">退出</a></c:if><a href="SelallServlet">留言</a><c:if
            test="${name.eu_status==2}"><a href="WEB-INF/manage/index.jsp">去后台</a></c:if></div>
    <div class="navbar">
        <ul class="clearfix">
            <c:choose>
                <c:when test="${empty selected_fid}">
                    <li class="current"><a href="indexSelect">首页</a></li>
                </c:when>
                <c:otherwise>
                    <li><a href="indexSelect">首页</a></li>
                </c:otherwise>
            </c:choose>
            <c:forEach var="f" items="${flist}">
                <c:choose>
                    <c:when test="${selected_fid == f.epc_id}">
                        <li class="current"><a href="selectProductList?fid=${f.epc_id }">${f.epc_name }</a></li>
                    </c:when>
                    <c:otherwise>
                        <li><a href="selectProductList?fid=${f.epc_id }">${f.epc_name }</a></li>
                    </c:otherwise>
                </c:choose>
            </c:forEach>
        </ul>
    </div>
</div>
<div id="childNav">
    <div class="wrap">
        <ul class="clearfix">
            <li class="first"><a href="javascript:searchHot('chocolate')">巧克力</a></li>
            <li><a href="javascript:searchHot('beef')">牛肉干</a></li>
            <li><a href="javascript:searchHot('biscuit')">饼干</a></li>
            <li><a href="javascript:searchHot('dry fruit')">水果干</a></li>
            <li><a href="javascript:searchHot('shampoo')">洗发水</a></li>
            <li><a href="javascript:searchHot('toothpaste')">牙膏</a></li>
            <li><a href="javascript:searchHot('body wash')">沐浴露</a></li>
            <li><a href="javascript:searchHot('dress')">连衣裙</a></li>
            <li><a href="javascript:searchHot('T-shirt')">T恤</a></li>
            <li><a href="javascript:searchHot('jeans')">牛仔裤</a></li>
            <%--<li><a href="javascript:searchHot('运动鞋')">运动鞋</a></li>
            <li><a href="javascript:searchHot('美容护肤')">美容护肤</a></li>
            <li><a href="javascript:searchHot('饰品')">饰品</a></li>--%>
            <li class="last"><input type="text" id="selectname" value="${search_words}"/><a
                    href="javascript:selectname()">搜索</a></li>
        </ul>
    </div>
</div>
<div id="main" class="wrap">
    <div class="lefter">
        <div class="box">
            <h2>商品分类</h2>
            <dl>
                <dt><a href="selectProductList">全部商品</a></dt>
                <c:forEach var="f" items="${flist}">
                    <dt><a href="selectProductList?fid=${f.epc_id }">${f.epc_name }</a></dt>
                    <c:forEach var="c" items="${clist}">
                        <c:if test="${f.epc_id==c.epc_parent_id}">
                            <c:if test="${p.epc_child_id!=c.epc_id}">
                                <dd><a href="selectProductList?cid=${c.epc_id }">${c.epc_name }</a></dd>
                            </c:if>
                        </c:if>
                    </c:forEach>
                </c:forEach>
            </dl>
        </div>
        <div class="spacer"></div>
        <div class="last-view">
            <h2>最近浏览</h2>
            <dl class="clearfix">
                <c:forEach var="lastp" items="${lastlylist}">
                    <dt><a href="selectProductView?id=${lastp.ep_id }"><img height="40"
                                                                            src="images/product/${lastp.ep_file_name }"/></a>
                    </dt>
                    <dd><a href="selectProductView?id=${lastp.ep_id }">${lastp.ep_name }</a></dd>
                </c:forEach>
            </dl>
        </div>
    </div>


    <div class="main">
        <div class="price-off">
            <h2>个人订单</h2>
            <c:if test="${not empty dan}">
                <table border="1" width="600px" height="100px" bordercolor="red">
                    <tr align="center">
                        <td class="field">订单号</td>
                        <td class="field">下单时间</td>
                        <td class="field">用户ID</td>
                        <td class="field">商品名称</td>
                        <td class="field">商品图片</td>
                        <td class="field">商品价格</td>
                        <td class="field">购买数量</td>
                        <%--<td class="field">商品库存</td>--%>
                    </tr>
                    <c:forEach var="d" items="${dan}">
                        <tr align="center">
                            <td>${d.eo_id }</td>
                            <td>${d.eo_create_time }</td>
                            <td>${d.eo_user_id }</td>
                            <td>${d.ep_name }</td>
                            <td><img src="images/product/${d.ep_file_name }" height="100" width="100"/></td>
                            <td>${d.ep_price }</td>
                            <td>${d.eod_quantity }</td>
                            <%--<td>${d.ep_stock }</td>--%>
                        </tr>
                    </c:forEach>
                </table>
            </c:if>
            <c:if test=" ${dan==null}">
                <a href="indexSelect">快去购买吧</a>
            </c:if>
        </div>

    </div>
</div>
<div id="footer">
    Copyright &copy; 2019 爱购物 All Rights Reserved. 苏ICP备案888888号
</div>
</body>
</html>


